package com.myblog.myblog.controller;

import com.myblog.myblog.service.AdminBlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/head")
public class IndexblogController {
    @Autowired
    private AdminBlogService adminBlogService;
    @RequestMapping("/blog/{id}")
    public String indexBlog(@PathVariable Long id, Model model){
        model.addAttribute("blog",adminBlogService.getAndConvert(id));
        return "head/indexblog";
    }
}
